package com.tarena.dang.actions.main;

import java.util.List;

import com.tarena.dang.pojos.Product;
import com.tarena.dang.services.ProductService;
import com.tarena.dang.services.impl.ProductServiceImpl;

public class NewProductAction {
	private List<Product> pros;
	private int topSize;

	public String execute() {
		ProductService service=new ProductServiceImpl();
		try {
			pros=service.findNewProduct(topSize);
			return "success";
		} catch (Exception e) {
			e.printStackTrace();
			return "fail";
		}
	}


	public int getTopSize() {
		return topSize;
	}

	public void setTopSize(int topSize) {
		this.topSize = topSize;
	}


	public void setPros(List<Product> pros) {
		this.pros = pros;
	}


	public List<Product> getPros() {
		return pros;
	}
}
